package tewntyOne;

public class Student {
    private String name;
    private int xuaHao;
    private int score;
    Student(String name,int xuaHao,int score){
        this.name=name;
        this.xuaHao=xuaHao;
        this.score=score;
    }

    public String getName(){
        return name;
    }
    public void setName(){
        this.name=name;
    }

    public int getXueHao(){
        return xuaHao;
    }
    public void setXueHao(){
        this.xuaHao=xuaHao;
    }

    public int getScore(){
        return score;
    }
    public void setScore(){
        this.score=score;
    }
    //排序
    public static void sortStudent(Student[] s){
        for(int i=0;i<s.length-1;i++){
            for(int j=0;j<s.length-1-i;j++){
                if(s[j].score<s[j+1].score){
                    Student temp=s[j];
                    s[j]=s[j+1];
                    s[j+1]=temp;
                }
            }
        }
    }
    //打印输出
    public void show(){
        System.out.println(name+","+xuaHao+","+score);
    }
}

